package pers.mobian.springsixth;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;
import pers.mobian.springsixth.connection.ContextConfig;
import pers.mobian.springsixth.service.StudentService;

import javax.annotation.Resource;

/**
 * @Date 2021/7/17 14:20
 * @Created mobian
 * @Description
 */
@Resource
public class MainTest1 {
	public static void main(String[] args) {

		// 启动spring容器
		AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ContextConfig.class);

		StudentService studentService = (StudentService)context.getBean("studentService", StudentService.class);
		studentService.showInfo();


	}
}
